package com.sky.controller.admin;


import com.sky.result.Result;
import com.sky.service.WorkCenterService;
import com.sky.vo.*;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping( "/admin/workspace")
@Slf4j
@Api(tags = "工作台接口")
public class WorkCenterController {


    @Autowired
    private WorkCenterService workCenterService;

    /**
     * 查看套餐总览
     */
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> overviewSetmeals(){

        log.info("查看套餐总览");
        SetmealOverViewVO setmealOverViewVO=workCenterService.selectOverviewSetmeals();

        return Result.success(setmealOverViewVO);
    }

    /**
     * 查看订单总览
     */
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> overviewDishes(){

        log.info("查看菜品总览");
        DishOverViewVO dishOverViewVO=workCenterService.selectOverviewDishes();

        return Result.success(dishOverViewVO);
    }
    /**
     * 订单管理
     */
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> overviewOrders(){

        log.info("查看订单管理");
        OrderOverViewVO orderOverViewVO=workCenterService.selectOverviewOrders();

        return Result.success(orderOverViewVO);
    }

    /**
     *查询今日运营数据
     */
    @GetMapping("/businessData")
    public Result<BusinessDataVO> businessData(){

        log.info("查询今日运营数据");
        BusinessDataVO businessDataVO=workCenterService.selectBusinessData();

        return Result.success(businessDataVO);
    }

}
